﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _00_单例模式
{

    public class MyRandom
    {
        private static Random _rd=null;
        public static Random Rand
        {
            get
            {
                if (_rd == null)_rd = new Random();
                return _rd;
            }
        }
    }
    internal class Program
    {
        static void Main(string[] args)
        {    
            for (int i = 0; i < 5; i++)
            {
                Console.WriteLine(MyRandom.Rand.Next(0,250));
            }
            Console.ReadKey();
        }
    }
}
